//
//  xPathStringVO.m
//  Moko
//
//  Created by cj848 on 11. 7. 25..
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "xPathStringVO.h"


@implementation xPathStringVO
@synthesize articleType = _articleType, articleLink = _articleLink, articleCommentCount = _articleCommentCount;
@synthesize articleTitle = _articleTitle;
@synthesize loginCheck = _loginCheck;
@synthesize articleDate = _articledate;
@synthesize articleCount = _articleCount;
@synthesize nameImage = _nameImage;
@synthesize nameText = _nameText;
@synthesize writable = _writable;
@synthesize errorDetection = _errorDetection;
@synthesize viewSubject = _viewSubject;
@synthesize viewLink = _viewLink;
@synthesize viewContent = _viewContent;
@synthesize viewDownload = _viewDownload;
@synthesize viewUserLevel = _viewUserLevel;
@synthesize commentDate = _commentDate;
@synthesize commentContent = _commentContent;
@synthesize commentUserLevel = _commentUserLevel;
@synthesize commentUserName = _commentUserName;
@synthesize viewDelete = _viewDelete;
@synthesize viewModify = _viewModify;
@synthesize viewUserName = _viewUserName;
@synthesize noticeList = _noticeList;
@synthesize page = _page;
-(id)init {
    self = [super init];
    if( self ) {
        self.articleLink = @"//td[contains(@class, 'article_subject')]//a";
        self.articleCommentCount = @"//font[contains(@class, 'comment_count')]";
        self.loginCheck = @"//font[@class='logged']";
        self.articleDate = @"//td[contains(@class, 'article_date')]//text()";
        // 이 xpath 쿼리를 한 후에 trimming 을 해서 길이 1 이상인걸 걸러내야됨
        self.articleCount = @"//td[contains(@class, 'article_count')]//text()[string-length(normalize-space(.)) > 0]";
        // 이 xpath 쿼리를 한 후에 trimming 을 해서 길이 1 이상인걸 걸러내야됨
        //self.articleTitle = @"//td[contains(@class, 'article_subject')]//text()[not(comment()) and not(parent::node()[contains(@class, 'comment_count')])]";
        self.articleTitle = @"//td[contains(@class, 'article_subject')]";
        self.articleType = @"//td[contains(@class, 'category_name')]//text()";
        self.nameImage = @"//img[contains(@src, 'icon/private_name/')]";
        self.nameText = @"//td[contains(@class, 'article_name')]";
        self.writable = @"//span[contains(@class, 'view_write')]";
        self.errorDetection = @"//td[@class = 'yeinsub']/b[. = 'ERROR']";
        self.viewSubject = @"//b[contains(@class, 'view_subject')]//text()";
        // 모든 내용 파싱해야됨
        self.viewContent = @"////span[contains(@class, 'view_content')]//td[contains(@valign, 'top')]//child::node()[not(comment())]";
        self.viewLink = @"//td[contains(@class, 'view_link')]//a";
        self.viewUserName = @"//span[contains(@class, 'view_username')]/span";
        self.viewDownload = @"//td[contains(@class, 'view_download')]//a";
        self.viewUserLevel = @"//font[@class = 'view_warning']";
        self.commentUserName = @"//nobr/span/font[contains(@class, 'commentname')]";
        self.commentUserLevel = @"//td//font[contains(@class, 'commentname')]//font[contains(@class, 'commentname')]//text()";
        self.commentDate = @"//font[contains(@class, 'commentdate')]//text()";
        self.commentContent = @"//font[contains(@class, 'commentcontent') and position() = %d]//text() | //font[contains(@class, 'commentcontent') and position() = %d]//br";
        self.viewDelete = @"//span[@class='view_delete']";
        self.viewModify = @"//span[@class='view_modify']";
        self.noticeList = @"//td[contains(@class, 'article_subject notice_list')]";
        self.page = @"//b[parent::font[@style = 'font-size:8pt']]";
    }
    return self;
}
-(void)dealloc {
    [super dealloc];
}
@end
